package com.swxy.service.Impl;

import com.swxy.dao.adminDao;
import com.swxy.pojo.admin;
import com.swxy.service.adminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class adminServiceImpl implements adminService {

    @Autowired
    private adminDao adminDao;
    @Override
    public admin adminLogin(String adminPhone, String adminPassword ) {
//        return adminDao.adminLogin(adminPhone,adminPassword);

        List<admin> list= adminDao.adminLogin(adminPhone,adminPassword);
        if(list==null||list.isEmpty()) {
            System.out.println("用户名，密码不匹配");
            return null;
        }else {
            System.out.println(list.get(0));
            return list.get(0);
        }
    }
    public void setAdminDao(com.swxy.dao.adminDao adminDao) {
        this.adminDao = adminDao;
    }

}
